/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"417E1257-4BEB-4FBC-B20C-DB817076A352"}
 */
var fResultado = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5AB5547B-8143-4041-9D3C-C1F764D2952F"}
 */
function seleccionaTodos(event) {
	var $fs = gensayo_to_ensayos.ensayos_to_resultados_dtl
	var $cant = databaseManager.getFoundSetCount($fs)
	
	fResultado = null
	
	for (var i = 1 ; i <= $cant ; i++)
	{
		var $rcd = $fs.getRecord(i)
		
		fResultado += $rcd.valor + '\n' 
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"46F873A3-73A5-4782-95B5-EBC8B71D9DC7"}
 */
function seleccionaNinguno(event) {
	fResultado = null
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8BFF6C01-AE30-42C7-B5E8-6714629807F3"}
 */
function aceptar(event) {
	forms.estadisticas_2.fResultados 	= fResultado.split('\n')
	forms.estadisticas_2.fResultado 	= fResultado
	cancelar()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} [event] the event that triggered the action
 *
 * @properties={typeid:24,uuid:"047C9D34-0E3A-412E-A226-93ACEE9D145C"}
 */
function cancelar(event) {
	var $win = application.getWindow('RESULTADOS')
	$win.hide()
	$win.destroy()
	fResultado = null
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"AB356BCE-CB32-4592-BA3D-F536ECFCE64D"}
 */
function onShow(firstShow, event) {
	fResultado = forms.estadisticas_2.fResultados.join('\n')
}
